package com.example.chapter;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.chapter.util.DateUtil;

public class ButtonStyleActivity extends AppCompatActivity {

    private TextView bs_result;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_button_style);
        bs_result = findViewById(R.id.bs_result);
    }

    public void doClick(View view) {
        String desc = String.format("%s 您点击了按钮: %s",DateUtil.getNowTime(),((Button)view).getText());
        bs_result.setText(desc);
    }
}